function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i/gi; var y=x.replace(re,'\n'); alert(y); } function convert_br(x){ var re = /
/gi; var y=x.replace(re,'\n'); return y; } function toggle_checkbox(x){ var y=document.getElementById(x); if (y.checked==true){ y.checked=false; }else{ y.checked=true; } } function toggle_photo(picture_id,filename,caption_id,caption,y2,y3){ var x1,x2, x3; // x1=document.getElementById('left_photo'); x2=document.getElementById(caption_id); x3=document.getElementById(picture_id); // x3.style.display='none'; x3.style.visibility='hidden'; x3.src='images/blank.gif'; // x1.style.display='none'; x3.width=y2; x3.height=y3; x3.align='center'; x3.src=filename; x3.onload=x3.style.visibility='visible'; x2.style.display='none'; x2.firstChild.nodeValue=caption; x2.style.display='block'; // x3.style.display='block'; } function waitPreloadPage() { //DOM if (document.getElementById){ document.getElementById('prepage').style.visibility='hidden'; }else{ if (document.layers){ //NS4 document.prepage.visibility = 'hidden'; } else { //IE4 document.all.prepage.style.visibility = 'hidden'; } } } function validateCalculator(x,this_form){ var msg=''; var generated_word='generated_word_'+x; var y=document.getElementById(generated_word).value; var word='word_'+x; var z=document.getElementById(word).value; if(this_form.name.value==''){ msg='Name is missing\n'; } if(this_form.email.value==''){ msg+='Email address is missing\n'; }else{ msg+=validEmailAddressForm(this_form.email.value); } if(this_form.question.value==''){ msg+='Message is missing\n'; } if(z.toLowerCase() != y.toLowerCase()){ msg+='\nTyped word is not correct. Please try again. \n'; } if(msg!=''){ msg+='\nPlease fill in missing information.\n'; alert(msg);return false; } if(y.toLowerCase()!=z.toLowerCase()) { alert('Typed word is incorrect. Please try again.\n');return false; } return true; } function validEmailAddressForm(x){ var e_address=x; var e_msg=''; if(e_msg=='')return e_msg; if(e_address.indexOf('.')<2){ e_msg=e_address+': Email address is in an invalid format.\n'; } if(e_address.indexOf('@')<1){ e_msg+=e_address+': Email address is in an invalid format.\n'; } return e_msg; } function validEmailAddress(x){ var e_address=document.getElementById(x).value; var e_msg=''; if(e_address=='')return e_msg; if(e_address.indexOf('.')<1){ e_msg='Email address is in an invalid format.\n'; } if(e_address.indexOf('@')<1){ e_msg='Email address is in an invalid format.\n'; } return e_msg; } function setInnerText(x,y){ if(document.all){ x.innerText = y; } else{ x.textContent = y; } } function getInnerText(x){ if(document.all){ return x.innerText; } else{ return x.textContent; } } function getWindowWidth(x){ if(x.clientWidth!=0){ return x.clientWidth; }else{ return x.innerWidth; }//if else } function getWindowHeight(x) { if(x.clientHeight){ return x.clientHeight; }else{ return x.innerHeight; }//if else if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } function getWindowWidth(x) { var windowHeight = 0; if (typeof(window.innerWidth) == 'number') { windowWidth = x.innerWidth; } else { if (document.documentElement && document.documentElement.clientWidth) { windowWidth = x.clientWidth; } else { if (document.body && document.body.clientWidth) { windowWidth = x.clientWidth; } } } return windowWidth; } function highlightStr(x_id,original_search_string,backC,highlightC){ var x=document.getElementById(x_id); alert(x.innerText);return; highlightStr2(x,original_search_string,backC,highlightC); return } function highlightStr2(x,original_search_string,backC,highlightC){ var y=x.getElementsByTagName('div'); var z; if(y.length==0){ alert(x.innerHTML); }else{ for (i=0; i<(y.length); i+=1){ highlightStr2(y[i],original_search_string,backC,highlightC); }//if }//if else return; } /* * This is the function that actually highlights a text string by * adding HTML tags before and after all occurrences of the search * term. You can pass your own tags if you'd like, or if the * highlightStartTag or highlightEndTag parameters are omitted or * are empty strings then the default tags will be used. */ function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) { // the highlightStartTag and highlightEndTag parameters are optional if ((!highlightStartTag) || (!highlightEndTag)) { highlightStartTag = ""; highlightEndTag = ""; } // find all occurences of the search term in the given text, // and add some "highlight" tags to them (we're not using a // regular expression search, because we want to filter out // matches that occur within HTML tags and script blocks, so // we have to do a little extra validation) var newText = ""; var i = -1; var lcSearchTerm = searchTerm.toLowerCase(); var lcBodyText = bodyText.toLowerCase(); while (bodyText.length > 0) { i = lcBodyText.indexOf(lcSearchTerm, i+1); if (i < 0) { newText += bodyText; bodyText = ""; } else { // skip anything inside an HTML tag if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) { // skip anything inside a